texture: Add error enum
authorMatthias Clasen <mclasen@redhat.com>
Tue, 14 Sep 2021 00:51:42 +0000 (20:51 -0400)
committerBenjamin Otte <otte@redhat.com>
Thu, 16 Sep 2021 22:25:22 +0000 (00:25 +0200)
gdk/gdktexture.c
gdk/gdktexture.h

index ec03c723707ce9660702bfadbff974491f93e740..4ef7cb5e9700016a4894c89b2c5529b3cc83cd06 100644 (file)
@@ -47,6 +47,8 @@
 
 #include <graphene.h>
 
+G_DEFINE_QUARK (gdk-texture-error-quark, gdk_texture_error)
+
 /* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
 void
 gtk_snapshot_append_texture (GdkSnapshot            *snapshot,
index e080679ca178ab48d8944104dccc91b2a709e154..927eb11bdfbd89c4f8fbe4fe8258d69e10793953 100644 (file)
@@ -38,6 +38,25 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkTexture, g_object_unref)
 
 typedef struct _GdkTextureClass        GdkTextureClass;
 
+#define GDK_TEXTURE_ERROR       (gdk_texture_error_quark ())
+
+GDK_AVAILABLE_IN_4_6
+GQuark gdk_texture_error_quark (void);
+
+/**
+ * GdkTextureError:
+ * @GDK_TEXTURE_ERROR_INSUFFICIENT_MEMORY: Not enough memory to handle this image
+ * @GDK_TEXTURE_ERROR_CORRUPT_IMAGE: The image data appears corrupted
+ * @GDK_TEXTURE_ERROR_UNSUPPORTED: The image format is not supported
+ *
+ * Possible errors that can be returned by `GdkTexture` constructors.
+ */
+typedef enum
+{
+  GDK_TEXTURE_ERROR_INSUFFICIENT_MEMORY,
+  GDK_TEXTURE_ERROR_CORRUPT_IMAGE,
+  GDK_TEXTURE_ERROR_UNSUPPORTED,
+} GdkTextureError;
 
 GDK_AVAILABLE_IN_ALL
 GType                   gdk_texture_get_type                   (void) G_GNUC_CONST;